﻿@model XSTDZ.ERP.Application.DataContracts.ReceivablePayableRecordDto
@*@using XSTDZ.ERP.Application.DataContracts.ReceivablePayableBillDto*@
@{
    ViewBag.Title = " - 收付款记录";
}
@section header{
     <link href="@Url.Content("~/Content/Controls.css")" rel="stylesheet" type="text/css" />
 <link href="@Url.Content("~/Content/Form.css")" rel="stylesheet" type="text/css" />
}
<h2>收付款记录</h2>
<div class="wp100">
    @using (Html.BeginForm()) {
        @Html.ValidationSummary(true)
  <table class="formtable">
    <thead>
        <tr>
            <th colspan="4">@* <h2>新增入库单</h2>*@
            <div id="toptoolbar"></div>
            <input type="hidden" value="@ViewBag.SFBillType" id="SFBillType" name="SFBillType" />
            </th>
        </tr>
    </thead>
    
    <tr style=" display:@ViewBag.ReveBillNone">
     <td class="title"> @Html.LabelFor(model => model.ReceivedMoney)</td>
        <td> @Html.TextBoxFor(model => model.ReceivedMoney, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.ReceivedMoney)
        <input type="hidden" value="@ViewBag.BillId" id="ReceivablePayableBillID" name="ReceivablePayableBillID" />
        
        </td>
        <td class="title">  @Html.LabelFor(model => model.ReceivedMoneyPft)</td>
          <td> @Html.TextBoxFor(model => model.ReceivedMoneyPft, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.ReceivedMoneyPft)
       
        </td>
     </tr>
      <tr style=" display:@ViewBag.PayBillNone">
     <td class="title"> @Html.LabelFor(model => model.PaidMoney)</td>
        <td> @Html.TextBoxFor(model => model.PaidMoney, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.PaidMoney)
        </td>
        <td class="title">  @Html.LabelFor(model => model.OmitMoney)</td>
          <td> @Html.TextBoxFor(model => model.OmitMoney, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.OmitMoney)
       
        </td>
     </tr>


         @* <tr style=" display:none;">
     <td class="title"> @Html.LabelFor(model => model.InvoiceType)</td>
        <td> @Html.DropDownListFor(model => model.InvoiceType, ViewBag.PJBillType as IEnumerable<SelectListItem>, "--请选择票据方式--")
        @Html.ValidationMessageFor(model => model.InvoiceType)
        </td>
        <td class="title">  @Html.LabelFor(model => model.TaxMoney)</td>
          <td> @Html.TextBoxFor(model => model.TaxMoney, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.TaxMoney)
       
        </td>
     </tr>  
             <tr style=" display:none;">
     <td class="title"> @Html.LabelFor(model => model.MoreTaxMoney)</td>
        <td> @Html.TextBoxFor(model => model.MoreTaxMoney, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.MoreTaxMoney)
        </td>
        <td class="title">  @Html.LabelFor(model => model.InvoiceNO)</td>
          <td> @Html.TextBoxFor(model => model.InvoiceNO, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.InvoiceNO)
       
        </td>
     </tr>  *@



            <tr>
     <td class="title"> @Html.LabelFor(model => model.PayType)</td>
        <td> 
        @Html.DropDownListFor(model => model.PayType, ViewBag.ZFBillType as IEnumerable<SelectListItem>, "--请选择支付方式--")
        @Html.ValidationMessageFor(model => model.PayType)
        </td>
        <td class="title">  @Html.LabelFor(model => model.Remarks)</td>
          <td> @Html.TextBoxFor(model => model.Remarks, new { @class = "text disablebg", @readonly = "readonly" })
        @Html.ValidationMessageFor(model => model.Remarks)
       
        </td>
     </tr>  


     @{var BillModel = ViewBag.BillModel as XSTDZ.ERP.Application.DataContracts.ReceivablePayableBillDto;}
       
     @if (BillModel.BillClassify)
                             {
         <tr>
                                   <td class="title">应付款 </td> 
                                   <td>@BillModel.BillPayable</td>
                                     <td class="title"> 应付优惠 </td> 
                                 <td>@BillModel.BillPayPft</td>
                                  </tr> 
         <tr>
                                   <td class="title">已付款 </td> 
                                   <td>@BillModel.BillPay</td>
                                     <td class="title"> 未付款 </td> 
                                 <td>@{var alltotal = @BillModel.BillPayable - @BillModel.BillPayPft - @BillModel.BillPay;} @alltotal</td>
                                  </tr> 
                             }
     else
     {  <tr>
                                <td class="title"> 应收款 </td> 
                                 <td>@BillModel.BillReceivable</td>
                                 <td class="title"> 应收优惠 </td> 
                                 <td>@BillModel.BillReceivPft</td>
          </tr> 
         <tr>
                                <td class="title"> 已收款 </td> 
                                 <td>@BillModel.BillReceiv</td>
                                 <td class="title"> 未收款 </td> 
                                 <td>@{var allRec=@BillModel.BillReceivable-@BillModel.BillReceivPft-@BillModel.BillReceiv;} @allRec</td>
          </tr> 
     }
        

    </table>
    }
</div>
<div class="wp100">
<div id="ReceivableItemsGrid" style="margin-top:20px" ></div>
</div>
<script type="text/javascript" src="@Url.Content("~/Content/js/ReceivablePayable/Detail.js")"></script>
